Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross platform support (e.g. with CMake) #77

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

neurolabusc
Copy link

@neurolabusc neurolabusc commented Feb 27, 2020

This pull request resolves issue.

  1. pigz can be compiled with CMake (@ningfei). Benefits include
  • Easy integration with other projects that use CMake
  • Simple ability to build pigz for preferred zlib variant. Specifically, the CMake files allow users to select the traditional system zlib or the higher performance zlib-ng or CloudFlare zlib.
  • Simple ability to build for the Windows operating system using either MInGW or MSVC.
  • Future users can easily extend the CMake to support different zlib variants. The zlib GitHub repository contains over 1300 forks. This provides a modular mechanism to allow pigz to use new zlib variants that have unique features or target specific architectures.
  1. pigz can now be compiled for Windows (@neurolabusc). While there are several other forks that provide Windows support, this new code is unique in that it supports filenames with non-Latin characters.
  2. To validate this pull request (and future development), we have created a Unix testing suite. We have used this to test many operating systems (Ubuntu 14.04, Ubuntu 18.04, MacOS, etc.) as well as ARM CPUs. Beyond measuring speed, it allows users to detect issues with zlib variants.

Caveats: files created by this tool store non-Latin characters in the FNAME tag using UTF8 (not Windows native UTF16). Names stored in the FNAME tag are interpreted as UTF8 characters. This mimics the behavior of pigz and gzip on Unix. Therefore, files created in one operating system can be extracted to another. None of these tools strictly conforms to rfc1952 which forbids non-Latin characters in FNAME. This probably reflects the fact that the gzip format was designed before UTF8 with its clever backward compatibility. Be aware that 7zip will create scrambled names for non-Latin characters, regardless of whether these were generated by pigz, gzip or 7zip itself.

@vielmetti
Copy link

Great to see these changes - let me know anything I can do to help them get tested.

@TBBle
Copy link

TBBle commented Jul 21, 2020

I assume this PR matches the binaries at https://github.com/neurolabusc/pigz/releases/tag/v2.4.win? I gave them a try, and I noticed that renaming it to unpigz.exe fails to make it decompress automatically. Probably because the code that grabs the program name does not allow for \ or the .exe tail.

The older 2.3-based Windows builds fixes this like so: kjk@8869ee6

@neurolabusc
Copy link
Author

@TBBle thanks. This sounds like a nice feature that extends this pull requests main focus for providing solid support for the Windows operating system. I am happy to revise this pull request or subsequently make a new pull request. @madler do you have a preference?

@neurolabusc
Copy link
Author

@madler I appreciate this is open source. However, I do think this PR makes it easier to compile pigz on Windows and supports Windows non-latin characters. It also eases building for the accelerated CloudShare zlib and zlib-ng. It would be great having this functionality in the main branch. The stall in having this PR reviewed is causing other PRs to be pulled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cross platform support (e.g. with CMake)?
4 participants